package com.jdy.haoduoaiteacher.util;

/**
 * 校验输入
 * 
 * @author hufei
 * 
 */
public class StringInfoMatch {
  private String PHONE_NUMBER = "^1\\d{10}$";
  private String PASSWORD_6_NUMBER_FORMAT = "\\d{6}";

  private String HEIGHT_FORMAT = "([1-9]\\d*(\\.\\d*[1-9])?)|(0\\.\\d*[1-9])";
  private String WEIGHT_FORMAT = "([1-9]\\d*(\\.\\d*[1-9])?)|(0\\.\\d*[1-9])";

  public boolean ifMatch6NimberFormat(String number) {
    return number.matches(PASSWORD_6_NUMBER_FORMAT);
  }

  public boolean ifMatchPhoneFormat(String phone) {
    return phone.matches(PHONE_NUMBER);
  }

  public boolean ifMatchHeightFormat(String height) {
    return height.matches(HEIGHT_FORMAT);
  }

  public boolean ifMatchWeightFormat(String weight) {
    return weight.matches(WEIGHT_FORMAT);
  }
}
